<?php

class Kd_Html_Form_Textarea extends Kd_Html_Form_Element {

    public function __construct() {
        parent::__construct();
        $this->templateName = 'form/textarea';
        $this->addClass('input', 'textarea');
    }

    public function getType() {
        return 'textArea';
    }

    protected function renderReadonly() {
        return '<span class="readonly">' . $this->getValue() . '</span>';
    }

    protected function renderEditable() {
        
        if (!$this->getEnabled()) {
            $this->addClass('disabled');
        }
        $this->setAttribute('id', $this->getId())->setAttribute('name', $this->getName());
        if (!$this->getEnabled()) {
            $this->setAttribute('disabled', 'disabled');
        }
        return '<textarea ' . $this->getAttributeHtml() . '>' . $this->getValue() . '</textarea>';
    }

}